﻿package  {
	
	public class Hydralisk extends Monster {

		public static const MOVEMENT_SPEED:Number = 15;
		
		public function Hydralisk(p_X:Number,p_Y:Number) {
			this.x = p_X;
			this.y = p_Y;
			this.setHp(30);
			this.setAttackDamage(15);
			this.setSpeed(2);
		}
		
		public function moveMonster(dir:Number):void
		{
			switch (dir)
			{
				case Monster.HAUT :
				{
					if (this.y - Hydralisk.MOVEMENT_SPEED >= 0)
						this.y -= Hydralisk.MOVEMENT_SPEED;
					break;
				}
				case Monster.DROITE :
				{
					if(this.x + this.width + Hydralisk.MOVEMENT_SPEED <= stage.width)
						this.x += Hydralisk.MOVEMENT_SPEED;
					break;
				}
				case Monster.BAS :
				{
					if (this.y + Hydralisk.MOVEMENT_SPEED <= stage.height)
						this.y+= Hydralisk.MOVEMENT_SPEED;
					break;
				}
				case Monster.GAUCHE :
				{
					if(this.x - Hydralisk.MOVEMENT_SPEED >= 0)
						this.x -= Hydralisk.MOVEMENT_SPEED;
					break;
				}
			}
		}

	}
	
}
